import axios from '@/utils/request'
function getArticleList(params) {
  return axios.get('/app/v1_1/articles', { params })
}
function getChannelList() {
  return axios.get('/app/v1_0/channels')
}
function addChannel(channel) {
  return axios.patch('/app/v1_0/user/channels', { channels: channel })
}
function delChannel(id) {
  return axios.delete('/app/v1_0/user/channels/' + id)
}
function getSearchSuggests(q) {
  return axios.get('/app/v1_0/suggestion', { params: { q } })
}
function getSearchResults(params) {
  return axios.get('/app/v1_0/search', { params })
}
export {
  getArticleList,
  getChannelList,
  addChannel,
  delChannel,
  getSearchSuggests,
  getSearchResults
}
